from mysql import mysql
import jieba
import re
import unicodedata
from lxml import etree


xianshang = mysql(host='192.168.1.220',password='elsearchCinghoo123.0',port=3306)
localhost = mysql()

# tt = localhost.query('select * from ztb_content limit 10')
data = xianshang.query('select * from ztb_content limit 10')

for v in data:
    #编码
    content = v['content'].encode('utf8')
    #去除html标签
    content = etree.HTML(text=v['content']).xpath('string(.)')
    #英文标点转换
    content = unicodedata.normalize('NFKC',content)
    print(content)
    exit()


print(data)












